package com.sinosoft.cpyy.service.impl;

import com.sinosoft.cpyy.dao.master.QuestionBankMapper;
import com.sinosoft.cpyy.dao.master.TestPaperMapper;
import com.sinosoft.cpyy.model.TestPaper;
import com.sinosoft.cpyy.model.vo.QuestionBankVo;
import com.sinosoft.cpyy.service.TestPaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class TestPaperServiceImpl implements TestPaperService {
    private final TestPaperMapper testPaperMapper;
    private final QuestionBankMapper questionBankMapper; //题库

    @Autowired
    public TestPaperServiceImpl(TestPaperMapper testPaperMapper, QuestionBankMapper questionBankMapper) {
        this.testPaperMapper = testPaperMapper;
        this.questionBankMapper = questionBankMapper;
    }

    @Override
    public List<TestPaper> findTestPaperInfo() {

        return testPaperMapper.findTestPaperInfo();
    }

    @Override
    public int updateTestPaperState(int testpaperId) {
        // TODO Auto-generated method stub
        return testPaperMapper.updateTestPaperState(testpaperId);
    }

    @Override
    public TestPaper selectByPrimaryKey(Integer testpaperId) {
        // TODO Auto-generated method stub
        return testPaperMapper.selectByPrimaryKey(testpaperId);
    }

    @Override
    public int updateTestPaperInfo(TestPaper testPaper) {
        // TODO Auto-generated method stub
        return testPaperMapper.updateTestPaperInfo(testPaper);
    }

    @Override
    public List<QuestionBankVo> findAllQuestionBank() {

        List<QuestionBankVo> findAllQuestionBank = questionBankMapper.findAllQuestionBank();

        return findAllQuestionBank;
    }


}
